<template>
  <el-table :data="tableData" stripe style="width: 100%">
    <el-table-column prop="create_time" label="注册日期" width="180"></el-table-column>
    <el-table-column prop="user_name" label="管理员姓名" width="180"></el-table-column>
    <el-table-column prop="city" label="注册地址"></el-table-column>
  </el-table>
</template>
<script>
import { baseUrl } from "../config/env";
export default {
  created() {
    this.$http
      .post(
        baseUrl + "/admin/adminList",
        {},
        { emulateJSON: true, withcredentials: true, credentials: true }
      )
      .then(data => {
        this.tableData = [];
        for (var i = 0; i < data.body.info.length; i++) {
          var newobj = {
            create_time: "",
            user_name: "",
            city: ""
          };
          newobj.user_name = data.body.info[i].user_name;
          newobj.create_time = data.body.info[i].create_time;
          newobj.city = data.body.info[i].city;
          this.tableData.push(newobj);
        }

        console.log(data.body.info);
      });
  },
  data() {
    return {
      tableData: []
    };
  }
};
</script>
<style scoped>
</style>
